UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ectDNT/WHGzkC/m1kyq/H93VhFA4Fmfu5Bfn8uwVCTw=' 
WHERE 
  key_id = 'd6ece33748ef7538250b18324f621d03b36c457035b5010c44a663c6556613de' 
  AND (
    token = 'ectDNT/WHGzkC/m1kyq/H93VhFA4Fmfu5Bfn8uwVCTw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033