UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yE8f3XB7xpIDY/A3rLejya5IH4Cksb9ygBuOOFgCkIo=' 
WHERE 
  key_id = '902017893f538ada93860d39a1a10390076eaa04d3dacd9e34e197e2e3811cef' 
  AND (
    token = 'yE8f3XB7xpIDY/A3rLejya5IH4Cksb9ygBuOOFgCkIo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051