UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TfsHXPV79HeUosQCwf7AoaCFNXavdjoDDoUen/LllX0=' 
WHERE 
  key_id = 'd8a8d342c3394d0c320bdcf45b969af22ed1a8445414f2e65ee2a9157b0bea4f' 
  AND (
    token = 'TfsHXPV79HeUosQCwf7AoaCFNXavdjoDDoUen/LllX0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048