UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CaB7Re+uKlzhC+EQue9I7Gx3tBU/SfgogGxxkb44CuI=' 
WHERE 
  key_id = 'cb9b1d95a20e796db23dd8482951060540933e8db530eb4b36e3a88baba22886' 
  AND (
    token = 'CaB7Re+uKlzhC+EQue9I7Gx3tBU/SfgogGxxkb44CuI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030