UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cL7o5aaLQa1UX4jJWqZ6Qn1dXR7cehia2bnqO80n/9A=' 
WHERE 
  key_id = '9b0905db28f6be40ede72e61bf297eace6f93883f90c51afac7b1ebb0173fb2b' 
  AND (
    token = 'cL7o5aaLQa1UX4jJWqZ6Qn1dXR7cehia2bnqO80n/9A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035