UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hDNFFVEBbmBK9iCfR0Y2GRvJ9QqpjYt2HMiL2iEEs3Y=' 
WHERE 
  key_id = '435698b2e049656521bb7d241cc0d841c6f1fc2bee691e1cd830928bf1996bd5' 
  AND (
    token = 'hDNFFVEBbmBK9iCfR0Y2GRvJ9QqpjYt2HMiL2iEEs3Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035