UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1RmOOmYumJfKtbO6Zpa0r97MTzpBfl8CbYz6yCX2ZSI=' 
WHERE 
  key_id = 'c39e6066c8e0d77739808f6e9260cbda7220b9f91443c08708c0ceb868fed468' 
  AND (
    token = '1RmOOmYumJfKtbO6Zpa0r97MTzpBfl8CbYz6yCX2ZSI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053