UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '79weD53bXBjIHCI2AuWuaQxauRF3MYudpcpe9I4PBTs=' 
WHERE 
  key_id = '5e176160808c51aba072565c7974498123b29fd8efd6f9009aa433d4e5ac8bb6' 
  AND (
    token = '79weD53bXBjIHCI2AuWuaQxauRF3MYudpcpe9I4PBTs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032