UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J4NqWwS11YxLhPgSCnfqtTjy/fJU3/j1qHIZZzGXRiQ=' 
WHERE 
  key_id = 'fe6a55640c28ee12855014cccf12665f4cdd42f3ee56cdf6eb20730107e1eb6a' 
  AND (
    token = 'J4NqWwS11YxLhPgSCnfqtTjy/fJU3/j1qHIZZzGXRiQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057