UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EGGcKDq0+AkJP5buW/9S1oG64UIceGNYENYRcXSgmMw=' 
WHERE 
  key_id = 'dcfdc126e93ec6b51f417f1d09b5e642c0bdd1e06f6a7bdca44e87dd23db91a8' 
  AND (
    token = 'EGGcKDq0+AkJP5buW/9S1oG64UIceGNYENYRcXSgmMw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016