UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H87p7fsaCOyDWKNGoAqwEHQxYvUMz6dDetH6aSXNZFg=' 
WHERE 
  key_id = 'db943a07c3a77709265957127e03e84cddf8a96fe3da86123e100110b3bb924c' 
  AND (
    token = 'H87p7fsaCOyDWKNGoAqwEHQxYvUMz6dDetH6aSXNZFg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029