UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uDlcJVALAulzo6k3t2G4V2MJGxg8o7BtdlwCSm1Wgxw=' 
WHERE 
  key_id = '2498bd75ff0818a3a6b19c12678706438b4fe0677c9e6ea0133fcd160eb0c42a' 
  AND (
    token = 'uDlcJVALAulzo6k3t2G4V2MJGxg8o7BtdlwCSm1Wgxw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033