UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yAC4CDxrGasY/3ANJkLLUfm8u9ESEFNjJsQn8j0rkeM=' 
WHERE 
  key_id = '1acf2ab93cdcc962a1d9c71a110bc371051b86673d9ce03c6457008c2edd2033' 
  AND (
    token = 'yAC4CDxrGasY/3ANJkLLUfm8u9ESEFNjJsQn8j0rkeM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037