UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PaiBWuRWsqFiVlae7uEsfd8g79XalIYodDPR713yMdw=' 
WHERE 
  key_id = 'c67550144287d08f28b6084d0c73840c2dc3ec4e2b54ee9af1a485816e59bb10' 
  AND (
    token = 'PaiBWuRWsqFiVlae7uEsfd8g79XalIYodDPR713yMdw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026