UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X1DQCfX0KhAZmc6bCBwjoIT0JiVfx54tbpsBGfvgkHs=' 
WHERE 
  key_id = 'de44e9285406bab4c578e316f2cdff75b86e9fd192a2ca668e2d2b00e9769758' 
  AND (
    token = 'X1DQCfX0KhAZmc6bCBwjoIT0JiVfx54tbpsBGfvgkHs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031