UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WP4EV0VeqALPrGGyw6v3fVZ/BaF+n87rTABpbjy18wI=' 
WHERE 
  key_id = 'fc5a6862ef14efa939f031cccc21bfa98bad86d2b7d6013702c7f7d07be68eba' 
  AND (
    token = 'WP4EV0VeqALPrGGyw6v3fVZ/BaF+n87rTABpbjy18wI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041