UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3Slru51bXd8/M2ZneWLCWn4TPwS1q2a1F1+56X6AuTM=' 
WHERE 
  key_id = '6b1c23c789e4d4b033c1a5a1e66fb9321bd9a8d606490bcb714276554a94ccec' 
  AND (
    token = '3Slru51bXd8/M2ZneWLCWn4TPwS1q2a1F1+56X6AuTM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016