UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f2V7GyY4t73vE3tdUrwQytWl4wR/+aP8OiNqYpC1XjM=' 
WHERE 
  key_id = '0273c11b4ab450e557975379691d1be9394894d8d20d627f0cd3f59117ca0b5c' 
  AND (
    token = 'f2V7GyY4t73vE3tdUrwQytWl4wR/+aP8OiNqYpC1XjM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034