UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pD/Y4ZlV4d9/ynVOKmF7mTJRPsOjpM0qw8xNyaDV90M=' 
WHERE 
  key_id = '0e10ac9541295cc09e7e7e6d7d5987cd766cae25c9d541f758992b6e298afaa2' 
  AND (
    token = 'pD/Y4ZlV4d9/ynVOKmF7mTJRPsOjpM0qw8xNyaDV90M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063