UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rxrTjc59O7Es4yX5pQZXD4tuprEEyFqoiIZeq7QOIX4=' 
WHERE 
  key_id = '499333030c6dc951a7b78fe2f4b639c4b51e189eb8ff7e73c92c6e3141952aea' 
  AND (
    token = 'rxrTjc59O7Es4yX5pQZXD4tuprEEyFqoiIZeq7QOIX4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030