UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '35BpthutbyHyGXDogxPvj2s/dR2jV0gF5krChxIV2n4=' 
WHERE 
  key_id = '65af05834f2c7cf5aa80c5e7042859ae49ec16f620b217a8f116c1cf40145682' 
  AND (
    token = '35BpthutbyHyGXDogxPvj2s/dR2jV0gF5krChxIV2n4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036