UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ygOpif3yw+qJdDvpw6fPbJeqzw3+KRIuD6RfM017H4s=' 
WHERE 
  key_id = 'ffac77dc348aa834fac17c9c8e8c7c5310a1ae1226b00dbab3fe9397f4abda13' 
  AND (
    token = 'ygOpif3yw+qJdDvpw6fPbJeqzw3+KRIuD6RfM017H4s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022