UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'suN6oa8j3NmC3OSbRCuRC0Vs7xZ01jHjJavyFdCA4EQ=' 
WHERE 
  key_id = '87029ba111b1dee62cdf9e9d7977b0a664bd579d526fcf98ac9a69025314c817' 
  AND (
    token = 'suN6oa8j3NmC3OSbRCuRC0Vs7xZ01jHjJavyFdCA4EQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030