UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OF6ZLySs3sVWAjjFNbeS/WqtxqzYnQykmXoI0YpViRg=' 
WHERE 
  key_id = '4262e576f9fc8b36223cb3586607e05f93cbda161645d825ea5cc773720bc358' 
  AND (
    token = 'OF6ZLySs3sVWAjjFNbeS/WqtxqzYnQykmXoI0YpViRg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030