UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YzHuRqAkoNpummtF/fpRhYeUquRQj3CHJBriuQ9Kg40=' 
WHERE 
  key_id = '26afcc753548b396ff3821c2ef25e40a94195dcc02c5ea2aa86bb2d55c8b04e8' 
  AND (
    token = 'YzHuRqAkoNpummtF/fpRhYeUquRQj3CHJBriuQ9Kg40=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037