UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lH8ZO05G6CmOoN5kNc0dgNca7MartCV/BhoLU/MqeWM=' 
WHERE 
  key_id = 'f1dae445419de42cf759318afbdc91a5a7e8209d2bf4aac50bca2a726f920d83' 
  AND (
    token = 'lH8ZO05G6CmOoN5kNc0dgNca7MartCV/BhoLU/MqeWM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034