UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NoIGSvLZHBYlFdjQJMawtg9tky//WCk7oVTEvLpNovw=' 
WHERE 
  key_id = '45de0247e0a0970a88d1b887bd165c91d302e3938d8f4d952f2de0bfbc8d6022' 
  AND (
    token = 'NoIGSvLZHBYlFdjQJMawtg9tky//WCk7oVTEvLpNovw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069