UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hr6Y2YUQgl6wfT4/cMLTtIVAVsyGIqcQnSQVahqCwmY=' 
WHERE 
  key_id = 'e4708667733de36751ab7251965ae94d05d14ef6294bac3a6bbd75a495e1cbef' 
  AND (
    token = 'hr6Y2YUQgl6wfT4/cMLTtIVAVsyGIqcQnSQVahqCwmY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028