UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '43jWttWUMa7EfhG+OE9AjEWC4olY2nQRqlFsW9fCFIU=' 
WHERE 
  key_id = '9890d11ea0c3cf31733c23dccd02f34f62b7138c24b6900a914540ca3c72faf9' 
  AND (
    token = '43jWttWUMa7EfhG+OE9AjEWC4olY2nQRqlFsW9fCFIU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035