UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C/dEAnIHftpS279ZyL17Yzc+8gi394ec4AJankmts3M=' 
WHERE 
  key_id = '7692ec0acf2e770ba873a961e8825acbba88513ca7b69bcca292e6e2cc429f82' 
  AND (
    token = 'C/dEAnIHftpS279ZyL17Yzc+8gi394ec4AJankmts3M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020