UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D+qEyCr/+12p/5UMG0dErZssWbdg4tGfrkPRLOHw9oM=' 
WHERE 
  key_id = '2ea458f3d2c216e98b78ed6b66ab768b06536e954fbb5952cae63f647bea5ea3' 
  AND (
    token = 'D+qEyCr/+12p/5UMG0dErZssWbdg4tGfrkPRLOHw9oM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058