UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DgO0XQ0llI8BVOHcP/y8OlET5SsR4yWevQAR+AVxCj0=' 
WHERE 
  key_id = '4a28656b676bd55020f7d46880ef217f1857159e9f54ec46ff4b86e253090568' 
  AND (
    token = 'DgO0XQ0llI8BVOHcP/y8OlET5SsR4yWevQAR+AVxCj0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035